# statistic about attributes with constant value
# useage:awk -f sta_constant.awk training.txt
# author:l0he1g&gmail.com

BEGIN{
	FS=",";
}
{
	if( FNR==1 ) next;
	if( FNR==2 ){
		for( i=1;i<=NF;i++ ){
			value[i]=$i;
			is_constant[i]=1;
		}
		next;
	}
  	for( i=1;i<=NF;i++ ){
		if( is_constant[i]==1 && $i!="" && $i!=value[i] ){
			is_constant[i]=0;
		}
	}
}
END{
	tmp=1;
	for( i=1;i<=NF;i++ ){
		if( is_constant[i]==1 ){	
			if( value[i]==" " )
				value[i]="_";
			printf("%6d-%-7s",i,value[i]);
			
			if( tmp++%7==0 )
				printf("\n");
		}
	}
			 printf("\n");
}
